<?php
if(!defined('ADMINPX') || !defined('ADMIN')) {
	exit('Access Denied');
}
$id=$_GET['id'];
$act=$_GET['act'];
if($act=='ok'){
   if(!$_POST[adminpost]){
	   echo"提交出错<br/>";
   }else{
	   Bingz_config('Bingz_k7t_username',$_POST['Bingz_k7t_username'],'post');
	   Bingz_config('Bingz_k7t_userpass',$_POST['Bingz_k7t_userpass'],'post');
     echo"提交成功<br/>";
	 }
   echo "正在自动返回.......<br/><a href=\"admin.php?action=Bingz\">请手动返回</a><br/><meta http-equiv=refresh content='3;url=admin.php?action=Bingz'>";
}elseif($act=='dongtai'){
	     $smsfsb=''.$Bingz_url_addon.'mod=login&act=dongtai';
       echo $contentzt=@file_get_contents(''.$smsfsb.'');
       if(!$contentzt){echo"获取数据失败";}
}elseif($act=='dongtaiok'){
	     $smsfsb=''.$Bingz_url_addon.'mod=login&act=dongtaiok&id='.$id.'';
       echo $contentzt=@file_get_contents(''.$smsfsb.'');     
       echo '<div class="admin_a"><a href="admin.php?">返回后台首页</a></div>';
}elseif($act=='fwok'){
	     if(!preg_match("/^([0-9A-Za-z\-\_])+@([0-9a-zA-Z\.])+([0-9A-Za-z\.])+$/",$_POST[mail])){
		       echo '邮箱错误！';
	     }elseif(!$_POST['name']){
		       echo '标题不能为空！';
	     }else{
           $smsfsb=''.$Bingz_url_addon.'mod=login&act=fwok&mail='.$_POST['mail'].'&name='.$_POST['name'].'&config='.$_POST['config'].'';
           $contentzt=@file_get_contents(''.$smsfsb.'');
           if($contentzt > '0'){
           	  echo '提交成功！';
           	}else{
           	  echo '提交失败！';
           	}
       }
       echo "<br/><a href=\"admin.php?action=Bingz\">返回页面</a><br/>";
}else{
       $Bingz_k7t_username=Bingz_config('Bingz_k7t_username');
       $Bingz_k7t_userpass=Bingz_config('Bingz_k7t_userpass');
	     $smsfsb=''.$Bingz_url_addon.'mod=login&username='.$Bingz_k7t_username.'&userpass='.$Bingz_k7t_userpass.'';
       $contentzt=@file_get_contents(''.$smsfsb.'');
       if(!$Bingz_k7t_username or !$Bingz_k7t_userpass){
          $contentzt='请输入账号';
       }elseif($contentzt != '0' && $contentzt < '0' ){
          $contentzt='账号错误';
       }else{
          $contentzt='登陆成功-<font color="#FF0000">'.$contentzt.'</font>';
       }
       $smtp_from=Bingz_config('email_smtp_from');
echo <<<end
<div class="admin">==槟榔助手==<br/></div>
  <div class="admin_b">
       更进一步的服务！
  </div>
	<form  method="post" action="admin.php?action=Bingz&act=ok">
  官方账号：($contentzt)<br/>
	<input class="ipt-text" type="text" name="Bingz_k7t_username" value="$Bingz_k7t_username" /><br/>
	账号密码: (<a href="http://www.k7t.cn">槟榔官方</a>)<br/>
	<input class="ipt-text" type="password" name="Bingz_k7t_userpass" value="$Bingz_k7t_userpass" /><br/>
	<input class="submit" type="submit" name="adminpost" value="提交编辑" />
</form>
<br/>
<div class="admin_a">
	<a href="admin.php?">返回后台首页</a>
</div>
end;
}
?>